package com.example.edupublisher.mapper;


import com.example.edupublisher.bean.TrafficKeywords;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: TrafficKeywordsMapper
 * Package: com.atguigu.edu.publisher.mapper
 * Description:
 *
 * @Author Mr.2
 * @Create 2023/9/11 15:06
 * @Version 1.0
 */
@Mapper
public interface TrafficKeywordsMapper {

    // 关键词统计
    @Select("SELECT\n" +
            "keyword,\n" +
            "SUM(keyword_count) keyword_count\n" +
            "FROM dws_traffic_source_keyword_page_view_window\n" +
            "PARTITION par#{date}\n" +
            "GROUP BY keyword\n" +
            "ORDER BY keyword_count desc;")
    List<TrafficKeywords> selectKeywords(@Param(value = "date") Integer date);
}
